﻿Module CE6uAPI
    Public Const OS_CE40 As Short = &H240
    Public Const OS_CE50 As Short = &H250
    Public Const OS_CE60 As Short = &H260
    Public Const OS_CE70 As Short = &H270
    Public Const OS_UNKNOWN As Short = &HFF0

    'Digital IO pin  
    Public Const DIO_PIN1 As Byte = &H1
    Public Const DIO_PIN2 As Byte = &H2
    Public Const DIO_PIN3 As Byte = &H4
    Public Const DIO_PIN4 As Byte = &H8
    Public Const DIO_PIN5 As Byte = &H10
    Public Const DIO_PIN6 As Byte = &H20
    Public Const DIO_PIN7 As Byte = &H40
    Public Const DIO_PIN8 As Byte = &H80
    'Watch Dog Timer define
    Public Const bWDT_MINUTE As Short = &H100
    Public Const bWDT_SECOND As Short = &H0
    Public Const bWDT_ENABLE As Short = &H1
    Public Const bWDT_DISABLE As Short = &H2
    Public Const bWDT_RELOAD As Short = &H3
    Public Const bWDT_EVENT As Short = &H4
    Public Const bWDT_EVENT_CLR As Short = &H5

    Public Structure SBC_DS2401
        Public dlBoardID As Double
        Public bBoardID() As Char
        Public sBoardID() As Char
    End Structure

    ' Hardware Library Control Function
    Public Declare Function AxBoardLoadLibrary Lib "CE6uAPI.dll" (ByRef dllname As Char) As Boolean
    Public Declare Function AxBoardReleaseLibrary Lib "CE6uAPI.dll" () As Boolean
    ' Hardware Monitor Function
    Public Declare Function AxGetCPUTemp Lib "CE6uAPI.dll" (ByRef fValue As Single) As Boolean
    Public Declare Function AxGetSYSTemp Lib "CE6uAPI.dll" (ByRef fValue As Single) As Boolean
    Public Declare Function AxGetCPUFAN Lib "CE6uAPI.dll" (ByRef fValue As Single) As Boolean
    Public Declare Function AxGetSYSFAN Lib "CE6uAPI.dll" (ByRef fValue As Single) As Boolean
    Public Declare Function AxGetCPUVcore Lib "CE6uAPI.dll" (ByRef fValue As Single) As Boolean
    Public Declare Function AxGetNBVTT Lib "CE6uAPI.dll" (ByRef fValue As Single) As Boolean
    Public Declare Function AxGet3V Lib "CE6uAPI.dll" (ByRef fValue As Single) As Boolean
    Public Declare Function AxGet5V Lib "CE6uAPI.dll" (ByRef fValue As Single) As Boolean
    Public Declare Function AxGet12V Lib "CE6uAPI.dll" (ByRef fValue As Single) As Boolean
    Public Declare Function AxGetNeg5V Lib "CE6uAPI.dll" (ByRef fValue As Single) As Boolean
    Public Declare Function AxGetNeg12V Lib "CE6uAPI.dll" (ByRef fValue As Single) As Boolean
    Public Declare Function AxGetVbat Lib "CE6uAPI.dll" (ByRef fValue As Single) As Boolean
    ' Digital IO Function
    Public Declare Function AxGetDI Lib "CE6uAPI.dll" (ByVal pin As Integer, ByRef pinData As Integer) As Boolean
    Public Declare Function AxGetDO Lib "CE6uAPI.dll" (ByVal pin As Integer, ByRef pinData As Integer) As Boolean
    Public Declare Function AxSetDO Lib "CE6uAPI.dll" (ByVal pin As Integer, ByRef pinData As Integer) As Boolean
    Public Declare Function AxGetDIOValidPin Lib "CE6uAPI.dll" (ByVal pin As Integer, ByRef pinData As Integer) As Boolean
    Public Declare Function AxSetDIODirection Lib "CE6uAPI.dll" (ByVal pin As Integer, ByRef pinData As Integer) As Boolean
    ' Watch dog Timer Function
    Public Declare Function AxWDTSetCounter Lib "CE6uAPI.dll" (ByVal timeCounter As Integer) As Boolean
    Public Declare Function AxWDTexec Lib "CE6uAPI.dll" (ByVal subFunction As Integer) As Boolean
    Public Declare Function AxWDTOutputPin Lib "CE6uAPI.dll" (ByVal sunFunction As Integer) As Boolean
    Public Declare Function AxWDTEvent Lib "CE6uAPI.dll" (ByVal sunFunction As Integer, ByRef repData As Integer) As Boolean
    ' Unique Board ID Function
    Public Declare Function AxGetBoardID Lib "CE6uAPI.dll" (ByRef sbc_bid As SBC_DS2401) As Boolean
    Public Declare Function AxGetBoardID Lib "CE6uAPI.dll" (ByRef sbc_bid As Byte) As Boolean
    ' BIOSID Function
    Public Declare Function AxSBC_BIOSID Lib "CE6uAPI.dll" (ByRef biosid As Char) As Boolean
    ' Utilities Function
    Public Declare Function AxOS_Version Lib "CE6uAPI.dll" () As Integer
    Public Declare Function AxSystemReboot Lib "CE6uAPI.dll" () As Boolean
    Public Declare Function AxSystemShutdown Lib "CE6uAPI.dll" () As Boolean
End Module
